# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: kastor <kastor@fobos.org.ar>

_name=pupnp
pkgname=libupnp
pkgver=1.14.14
pkgrel=1
pkgdesc='Portable Open Source UPnP Development Kit'
arch=(x86_64)
url="https://pupnp.sourceforge.io/"
license=(BSD)
depends=(glibc)
makedepends=(cmake)
provides=(libixml.so libupnp.so)
options=(debug)
source=($pkgname-$pkgver.tar.gz::https://github.com/$_name/$_name/archive/release-$pkgver.tar.gz)
sha512sums=('bf134e87981ceb051e101b104f143672711de19a1b35cfc89a49e18f3a289fab443fbdef4a918e1f8a464de38a1eccbeee9c847c243e35f73a92373473b2465f')
b2sums=('e1f69df386e2781cf17248733bf720c7e88c0d818ef8589648cdb4ec800c3a0cf381aa44fadcfdabcac31bf5d44091b8f421a1d53310046fb6a6c87e6035245f')

build() {
  cmake -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=None \
        -DUPNP_BUILD_STATIC=OFF \
        -Dblocking_tcp_connections=OFF \
        -Dreuseaddr=ON \
        -Wno-dev \
        -B build \
        -S $_name-release-$pkgver
  make VERBOSE=1 -C build
}

check() {
  make VERBOSE=1 test -C build
}

package() {
  make VERBOSE=1 DESTDIR="$pkgdir" install -C build
  install -vDm 644 $_name-release-$pkgver/COPYING -t "$pkgdir/usr/share/licenses/$pkgname"
  install -vDm 644 $_name-release-$pkgver/{ChangeLog,README.md} -t "$pkgdir/usr/share/doc/$pkgname"
}

# vim: ts=2 sw=2 et:
